package com.lwc.service.impl;

import com.alibaba.csp.sentinel.SphO;
import com.lwc.service.Stock;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class StockImpl implements Stock {
    @Override
    public Map queryStock() {

        Map map=new HashMap<>();
        if (SphO.entry("查询库存")){
            System.out.println("查询库存");
            map.put("num",22);
            map.put("code",200);
        SphO.exit();
        return map;
        }else {
map.put("msg","错误");
return map;
        }

    }
}
